<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <!--3.使用组件-->
    <cpn></cpn>
</div>

<div id="app2">
    <cpn></cpn>
</div>
<script src="../js/vue.js"></script>
<script>
    // 1.创建组件构造器对象
    const cpn = Vue.extend({
        template:
            `
            <div>
                <h2>模板</h2>
                <h2>模板</h2>
           </div>
            `
    })
    // 2.全局注册组件
    // Vue.component('cpn', cpn);

    const aaa = new Vue({
        el: "#app",
        data: {
            message: "hello,guys",
        }
    })

    const aaa2 = new Vue({
        el: "#app2",
        components :{
            cpn: cpn
        }
    })
</script>
</body>
</html>